import axios from 'axios';

const prefix = '/api/collection';

export function collectBlog(blogId, userId) {
  return axios.post(`${prefix}/collect.do`, { blog_id: blogId, user_id: userId });
}

export function uncollectBlog(blogId, userId) {
  return axios.post(`${prefix}/uncollect.do`, { blog_id: blogId, user_id: userId });
}

export function isCollected(blogId, userId) {
  return axios.get(`${prefix}/isCollected.do`, { params: { blog_id: blogId, user_id: userId } });
}

export function getCollectionCount(blogId) {
  return axios.get(`${prefix}/collectionCount.do`, { params: { blog_id: blogId } });
}

export function getMyCollections(userId) {
  return axios.get(`${prefix}/myCollections.do`, { params: { user_id: userId } });
} 